<?php
use yii\bootstrap\Alert;
use yii\helpers\Html;
use common\helps\Arc;
/* @var $this yii\web\View */
/* @var $searchModel app\models\search\ArcFilesSearchModel */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '人工智能语音识别结果';
$this->params ['breadcrumbs'] [] = $this->title;
?>
<div class="arc-files-index">
	
	<h5><?= Html::encode('点击屏幕外会自动隐藏该界面！') ?></h5>
	<?= $this->render('/common/widget')?>
	<?= $this->render('/common/dialog')?>
	<h4><?= Html::encode('识别结果如下：') ?></h4>
	<p>
        <?= Html::textarea('','', ['id'=>'result','class' => 'alert fade in','style'=>'width:100%','rows'=>'10']);?>
    </p>

</div>
<script type="text/javascript">
// $(function(){
// 	此处需要修改，因为会发生页面阻塞，发送不完成的话会一直阻塞网页，解决方法，1，js方法传输数据；2，利用多线程，但此方法要开启pthread,并且要系统为线程安全情况下
	var url = "send-asr-post?id=<?= $model->id ?>";
    $.ajax({
    	type:"get",
    	async:true,
    	cache:false,
    	url:url,/*url写异域的请求地址*/
    	success: function(datas){
			$("#loading").attr("hidden","hidden");
	        $("#success").removeAttr("hidden");
        	$("#result").text(datas);
		},
		error: function(error){
			$("#success").attr("hidden","hidden");
		   	$("#loading").attr("hidden","hidden");
			$("#faild").removeAttr("hidden");
        	$("#result").text("请确认网络是否连接！");
		}
    });
// );
</script>
